package academic.ui.client.event;

import com.google.gwt.event.shared.GwtEvent;
import com.gwtplatform.mvp.client.EventBus;

public class UploadPhotoEvent extends GwtEvent<UploadPhotoEventHandler>{

	
	private static final Type<UploadPhotoEventHandler> TYPE = new Type<UploadPhotoEventHandler>();
	
	public static Type<UploadPhotoEventHandler> getType() {
		return TYPE;
	}
	private String filename;
	
	public UploadPhotoEvent(String filename) {
		this.filename=filename;
	}
	
	public static void fire(EventBus eventBus, String fname) {
		eventBus.fireEvent(new UploadPhotoEvent(fname));
	}
	
	@Override
	protected void dispatch(UploadPhotoEventHandler handler) {
		handler.onUploadPhotoEvent(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<UploadPhotoEventHandler> getAssociatedType() {
		return getType();
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String getFilename() {
		return filename;
	}

}
